.class public abstract Lorg/microemu/android/MicroEmulatorActivity;
.super Landroid/app/Activity;
.source "MicroEmulatorActivity.java"


# instance fields
.field private activityThread:Ljava/lang/Thread;

.field private contentView:Landroid/view/View;

.field private handler:Landroid/os/Handler;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 16
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 18
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lorg/microemu/android/MicroEmulatorActivity;->handler:Landroid/os/Handler;

    return-void
.end method


# virtual methods
.method public getContentView()Landroid/view/View;
    .locals 1

    .prologue
    .line 41
    iget-object v0, p0, Lorg/microemu/android/MicroEmulatorActivity;->contentView:Landroid/view/View;

    return-object v0
.end method

.method public onConfigurationChanged(Landroid/content/res/Configuration;)V
    .locals 7
    .parameter "newConfig"

    .prologue
    const/4 v6, 0x0

    .line 53
    invoke-super {p0, p1}, Landroid/app/Activity;->onConfigurationChanged(Landroid/content/res/Configuration;)V

    .line 55
    invoke-virtual {p0}, Lorg/microemu/android/MicroEmulatorActivity;->getWindowManager()Landroid/view/WindowManager;

    move-result-object v4

    invoke-interface {v4}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v2

    .line 56
    .local v2, display:Landroid/view/Display;
    invoke-static {}, Lorg/microemu/device/DeviceFactory;->getDevice()Lorg/microemu/device/Device;

    move-result-object v4

    invoke-interface {v4}, Lorg/microemu/device/Device;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v1

    check-cast v1, Lorg/microemu/android/device/AndroidDeviceDisplay;

    .line 57
    .local v1, deviceDisplay:Lorg/microemu/android/device/AndroidDeviceDisplay;
    invoke-virtual {v2}, Landroid/view/Display;->getWidth()I

    move-result v4

    iput v4, v1, Lorg/microemu/android/device/AndroidDeviceDisplay;->displayRectangleWidth:I

    .line 58
    invoke-virtual {v2}, Landroid/view/Display;->getHeight()I

    move-result v4

    const/16 v5, 0x19

    sub-int/2addr v4, v5

    iput v4, v1, Lorg/microemu/android/device/AndroidDeviceDisplay;->displayRectangleHeight:I

    .line 59
    invoke-static {}, Lorg/microemu/MIDletBridge;->getMIDletAccess()Lorg/microemu/MIDletAccess;

    move-result-object v3

    .line 60
    .local v3, ma:Lorg/microemu/MIDletAccess;
    if-nez v3, :cond_1

    .line 68
    :cond_0
    :goto_0
    return-void

    .line 63
    :cond_1
    invoke-virtual {v3}, Lorg/microemu/MIDletAccess;->getDisplayAccess()Lorg/microemu/DisplayAccess;

    move-result-object v0

    .line 64
    .local v0, da:Lorg/microemu/DisplayAccess;
    if-eqz v0, :cond_0

    .line 65
    invoke-interface {v0}, Lorg/microemu/DisplayAccess;->sizeChanged()V

    .line 66
    invoke-virtual {v1}, Lorg/microemu/android/device/AndroidDeviceDisplay;->getFullWidth()I

    move-result v4

    invoke-virtual {v1}, Lorg/microemu/android/device/AndroidDeviceDisplay;->getFullHeight()I

    move-result v5

    invoke-virtual {v1, v6, v6, v4, v5}, Lorg/microemu/android/device/AndroidDeviceDisplay;->repaint(IIII)V

    goto :goto_0
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 1
    .parameter "icicle"

    .prologue
    .line 35
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 37
    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v0

    iput-object v0, p0, Lorg/microemu/android/MicroEmulatorActivity;->activityThread:Ljava/lang/Thread;

    .line 38
    return-void
.end method

.method public post(Ljava/lang/Runnable;)Z
    .locals 2
    .parameter "r"

    .prologue
    .line 25
    iget-object v0, p0, Lorg/microemu/android/MicroEmulatorActivity;->activityThread:Ljava/lang/Thread;

    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v1

    if-ne v0, v1, :cond_0

    .line 26
    invoke-interface {p1}, Ljava/lang/Runnable;->run()V

    .line 27
    const/4 v0, 0x1

    .line 29
    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lorg/microemu/android/MicroEmulatorActivity;->handler:Landroid/os/Handler;

    invoke-virtual {v0, p1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    move-result v0

    goto :goto_0
.end method

.method public setContentView(Landroid/view/View;)V
    .locals 0
    .parameter "view"

    .prologue
    .line 46
    invoke-super {p0, p1}, Landroid/app/Activity;->setContentView(Landroid/view/View;)V

    .line 48
    iput-object p1, p0, Lorg/microemu/android/MicroEmulatorActivity;->contentView:Landroid/view/View;

    .line 49
    return-void
.end method
